/*
    output:
    20
    30
*/


#include <stdio.h>

int main()
{
    struct node
    {
        int m;
        struct node *next;
    }x, y, z, *p;

    x.m = 10; y.m = 20; z.m = 30;
    x.next = &y; y.next = &z; z.next = NULL;
    p = x.next;
    while (p != NULL)
    {
        printf("%d\n", p->m);
        p = p->next;
    }
    
    return 0;
}